package com.ala4.oxcafe.repository;

import com.ala4.oxcafe.boot.page.PageDomain;
import com.ala4.oxcafe.common.utils.object.ObjectUtil;
import com.ala4.oxcafe.entity.TestUserInfo;
import com.ala4.oxcafe.repository.mapper.TestUserInfoMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * 测试用户菜单Repository
 *
 * @author PING
 * @date 2025-03-25
 */
@Repository
public class TestUserInfoRepository extends ServiceImpl<TestUserInfoMapper, TestUserInfo> implements IService<TestUserInfo> {

    public IPage<TestUserInfo> selectTestUserInfoPage(PageDomain pageDomain, TestUserInfo testUserInfo) {

        LambdaQueryWrapper<TestUserInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ObjectUtil.isNotNull(testUserInfo.getId()), TestUserInfo::getId, testUserInfo.getId());
//        queryWrapper.gt(TestUserInfo::getId, 1904084261895185373L);

        return this.page(pageDomain.toPlusPage(), queryWrapper);
    }
}
